package com.cyy.dyeing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyy.dyeing.dto.UserDto;
import com.cyy.dyeing.model.Role;
import com.cyy.dyeing.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author: cyy
 * @Date: 2024/7/22
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Update("update t_user set u_status=#{targetStatus} where u_id=#{u_id} and u_status=#{currentStatus}")
    int updateStatus(@Param("u_id") String u_id,
                     @Param("currentStatus") String currentStatus,
                     @Param("targetStatus") String targetStatus);

    @Select("select * from t_user where u_id=#{uId}")
    User getUserById(String uId);
}
